﻿<Window x:Class="DaphneForms.Licenses"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Použité knihovny" Height="350" Width="500" MinHeight="300"  MinWidth="500"
        ShowInTaskbar="False" 
        WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="*" />
            <RowDefinition Height="36" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="26" />
                <RowDefinition Height="26" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="110" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <TextBlock FontWeight="Bold" Grid.Row="0" Grid.Column="0" Margin="3">Jméno programu:</TextBlock>
            <TextBlock FontWeight="Bold" Grid.Row="1" Grid.Column="0" Margin="3">URL programu:</TextBlock>
            <TextBlock x:Name="uxProgramName" Grid.Row="0" Grid.Column="1" Margin="3"/>
            <TextBlock Grid.Row="1" Grid.Column="1" Margin="3">
                <Hyperlink x:Name="uxLink" RequestNavigate="Hyperlink_RequestNavigate">
                    <TextBlock x:Name="uxURL" />
                </Hyperlink>
            </TextBlock>                      
        </Grid>
        <GroupBox Header="Použíté knihovny" Grid.Row="1" Margin="3">
            <DataGrid x:Name="uxLibraries" Margin="3" HeadersVisibility="None" ItemsSource="{Binding}" AutoGenerateColumns="False"
                      CanUserAddRows="False" CanUserDeleteRows="False" >                              
                <DataGrid.Columns>
                    <DataGridTemplateColumn Width="*">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LibraryName}" />
                                    <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=Author}"/>
                                    <TextBlock Grid.Row="1" Grid.ColumnSpan="2">
                                        <Hyperlink NavigateUri="{Binding Path=URL}" RequestNavigate="Hyperlink_RequestNavigate">
                                            <TextBlock Text="{Binding Path=URL}" />
                                        </Hyperlink>
                                    </TextBlock>                                    
                                </Grid>                                         
                            </DataTemplate>                            
                        </DataGridTemplateColumn.CellTemplate>                        
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
                <DataGrid.CellStyle>
                    <Style TargetType="DataGridCell">
                        <Style.Triggers>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter Property="Background" Value="White" />
                                <Setter Property="Foreground" Value="Black" />
                            </Trigger>
                        </Style.Triggers>                        
                    </Style>
                </DataGrid.CellStyle>
            </DataGrid>            
        </GroupBox>                        
        <Button x:Name="btnClose" Grid.Row="2" Width="100" HorizontalAlignment="Right" Margin="6">Zavřít</Button>
    </Grid>
</Window>
